home *** CD-ROM | disk | FTP | other *** search
- #ifndef NULLBUF
-
- #include "global.h"
-
- /* Basic message buffer structure */
- struct mbuf {
- struct mbuf *next; /* Links mbufs belonging to single packets */
- struct mbuf *anext; /* Links packets on queues */
- int16 size; /* Size of associated data buffer */
- int refcnt; /* Reference count */
- struct mbuf *dup; /* Pointer to duplicated mbuf */
- char *data; /* Active working pointers */
- int16 cnt;
- };
- #define NULLBUF (struct mbuf *)0
- #define NULLBUFP (struct mbuf **)0
- #if defined(__STDC__) || defined(__TURBOC__)
- void enqueue(struct mbuf **q,struct mbuf *bp);
- void hex_dump(struct mbuf **bpp);
- void ascii_dump(struct mbuf **bpp);
- void append(struct mbuf **bph,struct mbuf *bp);
- void free_q(struct mbuf **q);
- void trim_mbuf(struct mbuf **bpp,int16 length);
- struct mbuf *alloc_mbuf(int16 size);
- struct mbuf *free_mbuf(struct mbuf *bp);
- struct mbuf *dequeue(struct mbuf **q);
- struct mbuf *copy_p(struct mbuf *bp,int16 cnt);
- struct mbuf *free_p(struct mbuf *bp);
- struct mbuf *qdata(char *data,int16 cnt);
- struct mbuf *pushdown(struct mbuf *bp,int16 size);
- int16 pullup(struct mbuf **bph,char *buf,int16 cnt);
- int16 dup_p(struct mbuf **hp,struct mbuf *bp,int16 offset,int16 cnt);
- int16 len_mbuf(struct mbuf *bp);
- int16 dqdata(struct mbuf *bp,char *buf,unsigned cnt);
- int16 len_q(struct mbuf *bp);
- int32 pull32(struct mbuf **bpp);
- int32 get32(char *cp);
- int16 pull16(struct mbuf **bpp);
- int16 get16(char *cp);
- char pullchar(struct mbuf **bpp);
- char *put16(char *cp,int16 x);
- char *put32(char *cp,int32 x);
- #else
- void enqueue(),hex_dump(),ascii_dump(),append();
- void free_q();
- void trim_mbuf();
- struct mbuf *alloc_mbuf(),*free_mbuf(),*dequeue(),*copy_p(),*free_p(),*qdata(),
- *pushdown();
- int16 pullup(),dup_p(),len_mbuf(),dqdata(),len_q();
- int32 pull32(),get32();
- int16 pull16(),get16();
- char pullchar(),*put16(),*put32();
- #endif
- #define AUDIT(bp) audit(bp,__FILE__,__LINE__)
-
-
- #endif /* NULLBUF */
-
-
-